package com.zijie.core.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JsonResult<T> {
    private String code;
    private String msg; // Changed from message to msg
    private T data;
    public static JsonResult success(Object data) {
        return new JsonResult("200", "操作成功", data);
    }
    public static JsonResult error(String message) {
        return new JsonResult("500", message, null);
    }
    public static JsonResult error(String code, String message) {
        return new JsonResult(code, message, null);
    }
    public static JsonResult error(String code, String message, Object data) {
        return new JsonResult(code, message, data);
    }


}
